﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using grounding.nao;
using grounding.grounder;
using grounding.nao.sensors;
using grounding.parser.Parsers;

namespace grounding.tests.NaoTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Nao nao = new Nao("128.208.6.135", 9559);

            Console.WriteLine("Please enter the category that we are gathering training data for:");
            string category = Console.ReadLine();
            Category cat = Category.GetCategory(category);

            List<ISensorFrame> data = new List<ISensorFrame>();
            List<Label> labels = new List<Label>();

            Console.WriteLine("Enter the label name for this frame:");
            string input;
            while ((input = Console.ReadLine().ToLower()) != "exit")
            {
                labels.Add(Label.GetLabel(input));
                data.Add(nao.GetSensorFrame());
            }

            Console.WriteLine("Name this training data set:");
            TrainingData trData = new TrainingData(Console.ReadLine(), cat.Identifier, data.ToArray(), labels.ToArray());
            Console.WriteLine("Saving training data files...");
            trData.SaveToDisk();

            nao.Disconnect();
        }
    }
}
